#!/usr/bin/env python
import random

def unDuplicate(l):
    pass


def secendLargest(l):
    if l[0] < l[1]:
        l[0] = l[1]
        l[1] = l[0] - l[1]
        l[0] = l[0] - l[1]


    for i in l[2:]:
        if i > l[1]:
            if i >l[0]:
                l[1] = l[0]
                l[0] = i
            else:
                l[1] = i

    return l[1]



def reportNum(l, n):
    
    '''
    循环报数，输出顺序
    '''
    count = 1
    i = 0
    a =  []
    while True:
        if count % n ==0:
            a.append(l[i])
            del l[i]
            i -= 1
        if i == len(l) - 1:
            i = 0
        else:
            i +=1
        count += 1
        if len(l) == 1:
            a.append(l[0])
            break
    return a

def strNumAdd(num1, num2):
    '''
    字符串数字相加
    '''
    a = list(num1)
    b = list(num2)
    a = a[::-1]
    b = b[::-1]
    c = []

    count = 0
    k = 0
    if len(a) > len(b):
        count = len(a)
    else:
        count = len(b)

    for i in range(count):
        if i > len(a) - 1:
            m1 = 48
        else:
            m1 = ord(a[i])
        if i > len(b) - 1:
            m2 = 48
        else:
            m2 = ord(b[i])

        chr1 = m1 +m2 +k - 48
        if chr1 > 57:
            k = 1
            c.append(chr(chr1 - 10))
        else:
            k = 0
            c.append(chr(chr1))
    return  ''.join(c[::-1])



l = [1,2,3,4,5,6,7,8,9,10]
print(reportNum(l, 5))
print(strNumAdd('12345', '1255'))
































